﻿using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Runtime.Serialization.Json;
using System.Xml.Serialization;
using System.IO;
using System.Xml;
using System.Runtime.Serialization.Formatters.Soap;
using System.Collections.Generic;
using System.Collections;
using System.Runtime.Serialization;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        MutilHotelResponse mr = new MutilHotelResponse();
        ResultRes rr = new ResultRes();
        rr.Message = "ok";
        rr.ReturnValue = "1";


        SampleHotel sh = new SampleHotel();
        sh.CHNName = "CHNName";
        sh.Country = "Country";
        sh.ENGName = "ENGName";
        sh.HotelCode = "HotelCode";
        sh.Lat = "Lat";
        sh.Lng = "Lng";
        sh.State = "State";

        SampleHotel[] list = { sh, sh, sh };
        mr.Result = rr;
       // mr.Hotellist = list;
        string response = new SerializeHelper().ToSoap<MutilHotelResponse>(mr);
        Response.Write(response);

    }

    [AjaxPro.AjaxMethod]
    public string GetObjList(string xml)
    {
        try
        {
            XmlSerializer ser = new XmlSerializer(typeof(ResultRes));
            System.Xml.XmlTextReader reader = new System.Xml.XmlTextReader(new System.IO.MemoryStream(System.Text.Encoding.Default.GetBytes(xml)));
            ResultRes resultRes = (ResultRes)(ser.Deserialize(reader));
            return resultRes.ToString();
        }
        catch { }
        return string.Empty;
    }
}
